const { execSync } = require('child_process');
const path = require('path');

// Hvigor wrapper for HarmonyOS projects
const HVIGOR_VERSION = '5.0.6';

try {
  // Execute hvigor with the specified version
  const hvigorPath = path.join(__dirname, '..', 'node_modules', '@ohos', 'hvigor', 'bin', 'hvigor.js');
  execSync(`node ${hvigorPath} ${process.argv.slice(2).join(' ')}`, { stdio: 'inherit' });
} catch (error) {
  console.error('Hvigor execution failed:', error.message);
  process.exit(1);
}
